import { Application } from "kilom/lib/Application";
import { ConnectorMain } from "../servers/connector/ConnectorMain";
import { GameMain } from "../servers/game/GameMain";
import { GateMain } from "../servers/gate/GateMain";
import { SvrType } from "../config/SvrCfg";

/**
 * 初始化服务器
 * @param app 
 */
export async function initSvrs(app: Application) {

    switch (app.stype) {
        case SvrType.gate:
            new GateMain(app).init();
            break;
        case SvrType.connector:
            new ConnectorMain(app).init();
            break;
        case SvrType.game:
            await new GameMain(app).init();
            break;
    }

}